<?php
/* $Id: testbook.php 25 2011-02-18 16:22:57Z jim2212001@gmail.com $ */
require_once 'config.php';
require_once 'libs/Book.class.php';
?>
<form action="testbook.php?action=search" method="post">
<input name="q" value="<?=$_POST['q'];?>" />
<input type="submit" value="search" />
</form>
<?php
$book = new Book();
if($_GET['action']=='search'){
  $book->query($_POST['q']);
}else{
  $book->query('0321544285');
}
$feed=$book->getEntries();
echo 'Total '.$book->getResults().' results<hr />';
foreach($feed as $entry){
  echo '<img src="'.$entry->getThumbLink().'" /><br />';
  echo '<b>Title</b> <a href="'.
	$entry->getInfoLink().'">'.
	$entry->getTitle().'</a>';
  echo ' By '.$entry->getAuthor().'<br />';
  echo $entry->getPublisher().', '.$entry->getFormat().'<br />';
  echo '<b>ISBN10</b> '.$entry->getISBN10().'<br />';
  echo '<b>ISBN13</b> '.$entry->getISBN13().'<br />';
  echo '<hr />';
}
?>
<form action="testbook.php?action=search" method="post">
<input name="q" value="<?=$_POST['q'];?>" />
<input type="submit" value="search" />
</form>
